const { error } = require("../../utils/response");

const authMiddleware = async (ctx, next) => {
    if(ctx.state.admin){
        await next();
    }else{
        error(ctx, '没有权限', null, 403);
    }
}

module.exports = authMiddleware;